package go84;

import java.util.*;
import javax.microedition.location.*;


public class Route {
	private Vector points;
	public Route() {
		points=new Vector();
	}
	public void addPoint(Point p) {
		points.addElement(p);
	}
	public int size() {
		return points.size();
	}
	public void removePoint(int index) {
		points.removeElementAt(index);
	}
	public Point point(int index) {
		if (index>=size())
			return null;
		return (Point)points.elementAt(index);
	}
	public void setPoint(Point p, int index) {
		points.setElementAt(p, index);
	}
	public String toString(int grid) {
		if (size()==0) {
			return "";
		}
		String res="";
		for (int i = 0; i < size(); i++) {
			res=res+point(i).toString(grid) + "\n\n";
		}
		return res.substring(0,res.length()-2);
	}
}